package dissertation.examples.ejb11.stateful;

import javax.naming.Context;
import javax.naming.InitialContext;
import java.util.Properties;

public class CountClient {
    public static void main(String[] args) throws Exception {
        Properties properties = System.getProperties();
        Context context = new InitialContext(properties);
        CountHome countHome = (CountHome) context.lookup("CountHome");
        Count countFromFive = countHome.create(5);
        Count countFromTwo = countHome.create(2);
        System.out.println(countFromFive.count());
        System.out.println(countFromFive.count());
        System.out.println(countFromTwo.count());
        System.out.println(countFromTwo.count());
        System.out.println(countFromFive.count());
        countFromFive.remove();
        countFromTwo.remove();
    }
}
